package com.i2bt.util;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface.OnClickListener;
import android.view.View;
import android.widget.EditText;

public class AlertDialogHelp {
	
	private static View commonView;
	
	public static void showEditDialog(Activity activity, String title, 
			String hintMeg, String editMesg, OnClickListener positionBtnListener,
			OnClickListener negativeBtnListener) {
		
		EditText editText = new EditText(activity);
		editText.setHint(hintMeg);
		editText.setText(editMesg);
		commonView = editText;
		
		AlertDialog.Builder dialog = new Builder(activity);
		dialog.setTitle(title)
		.setView(commonView)
		.setPositiveButton("确定", positionBtnListener)
		.setNegativeButton("取消", negativeBtnListener)
		.create().show();
	}
	
	public static void showConfirmDialog(Activity activity, String title, String message, 
			OnClickListener positionBtnListener, OnClickListener negativeBtnListener) {
		AlertDialog.Builder dialog = new Builder(activity);
		dialog.setTitle(title)
		.setMessage(message)
		.setPositiveButton("确定", positionBtnListener)
		.setNegativeButton("取消", negativeBtnListener)
		.create().show();
	}
	
	public static View getCommonView() {
		return commonView;
	}
	
}
